package client;

import lombok.SneakyThrows;
import org.zjx.client.SocketClient;
import org.zjx.core.SocketConfig;

import java.util.Map;

public class Client {
    @SneakyThrows
    public static void main(String[] args) {
        SocketConfig config = new SocketConfig();
        config.setPort(8888);

        SocketClient client = new SocketClient(config);
        client.setMessageListener(System.out::println);
        client.connect();

        // 5. 发送测试命令
        while (true) {
            client.sendCommand("USER_QUERY", Map.of("userId", 123));
            client.sendCommand("LOCAL_TEST", Map.of("param", "test"));
            Thread.sleep(5000);
        }

//        client.sendCommand("USER_QUERY", Map.of("userId", 123));
//        client.sendCommand("dsva_453", Map.of("userId", 123));

//        client.disconnect();
    }
}
